﻿#region Using's

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Serialization.Formatters.Soap;
using LightPersist.Storage;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MyUtils;
using System.Xml.Serialization;
using System.IO;
using System.Runtime.Serialization;
using System.Xml;
using System.Text;

#endregion

namespace LightPersist.XmlStorageTests
{
	[TestClass]
	public class TestInmemoryStorage : TestStorage
	{
		InmemoryStorage _last;

		protected override IStorage CreateStorage()
		{
			_last = new InmemoryStorage();
			return _last;
		}

		protected override void ReopenStorage()
		{
			base.ReopenStorage();
			var state = _last.Reflect("_idToObjectMap");
			sut = CreateStorage();
			sut.Connect(lastConnectionString);
			_last.Reflect("_idToObjectMap", state);
		}

//		[Serializable]
//		public class a// : ISerializable
//		{
//			public string test = "test_value";
//
//			[XmlIgnore]
//			public b b;
//
////			public a(SerializationInfo info, StreamingContext lightPersistContext)
////			{
////				
////			}
////			public void GetObjectData(SerializationInfo info, StreamingContext lightPersistContext)
////			{
////				
////			}
////
////			public a()
////			{
////				
////			}
//		}
//
//		public class b
//		{
//			public b(string s)
//			{
//				
//			}
//
//		}
//
//		[TestMethod]
//		public void Should_serialize_unusal_class()
//		{
//			testObectState.Set("X", 45);
//			var ser = new XmlSerializer(typeof(a[]));
//			var ms = new MemoryStream();
//			ser.Serialize(ms, new[]{new a(), new a() });
//			Trace.WriteLine(Encoding.UTF8.GetString(ms.GetBuffer(), 0, (int)ms.Length));
//			Assert.Inconclusive();
//		}

	}
}